// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]

mod debug;
mod deserialize;
mod serialize;

/// Contains information about a pending rename operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PendingRenameInfo {
    /// Output only. The name of the rename operation.
    pub operation: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PendingRenameInfo {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.operation = v.into();
        self
    }
}

impl wkt::message::Message for PendingRenameInfo {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
    }
}

/// A folder resource. This resource can only exist in a hierarchical namespace
/// enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Folder {
    /// Identifier. The name of this folder.
    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
    pub name: std::string::String,

    /// Output only. The version of the metadata for this folder. Used for
    /// preconditions and for detecting changes in metadata.
    pub metageneration: i64,

    /// Output only. The creation time of the folder.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The modification time of the folder.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Only present if the folder is part of an ongoing RenameFolder
    /// operation. Contains information which can be used to query the operation
    /// status. The presence of this field also indicates all write operations are
    /// blocked for this folder, including folder, managed folder, and object
    /// operations.
    pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl Folder {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::Folder::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [metageneration][crate::model::Folder::metageneration].
    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.metageneration = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::Folder::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::Folder::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
    pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::PendingRenameInfo>,
    {
        self.pending_rename_info = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
    pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::PendingRenameInfo>,
    {
        self.pending_rename_info = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for Folder {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.Folder"
    }
}

/// Request message for GetFolder. This operation is only applicable to a
/// hierarchical namespace enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFolderRequest {
    /// Required. Name of the folder.
    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
    pub name: std::string::String,

    /// Makes the operation only succeed conditional on whether the folder's
    /// current metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation only succeed conditional on whether the folder's
    /// current metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetFolderRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for GetFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
    }
}

/// Request message for CreateFolder. This operation is only applicable to a
/// hierarchical namespace enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFolderRequest {
    /// Required. Name of the bucket in which the folder will reside. The bucket
    /// must be a hierarchical namespace enabled bucket.
    pub parent: std::string::String,

    /// Required. Properties of the new folder being created.
    /// The bucket and name of the folder are specified in the parent and folder_id
    /// fields, respectively. Populating those fields in `folder` will result in an
    /// error.
    pub folder: std::option::Option<crate::model::Folder>,

    /// Required. The full name of a folder, including all its parent folders.
    /// Folders use single '/' characters as a delimiter.
    /// The folder_id must end with a slash.
    /// For example, the folder_id of "books/biographies/" would create a new
    /// "biographies/" folder under the "books/" folder.
    pub folder_id: std::string::String,

    /// Optional. If true, parent folder doesn't have to be present and all missing
    /// ancestor folders will be created atomically.
    pub recursive: bool,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
    pub fn set_folder<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::Folder>,
    {
        self.folder = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::Folder>,
    {
        self.folder = v.map(|x| x.into());
        self
    }

    /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.folder_id = v.into();
        self
    }

    /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.recursive = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
    }
}

/// Request message for DeleteFolder. This operation is only applicable to a
/// hierarchical namespace enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFolderRequest {
    /// Required. Name of the folder.
    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
    pub name: std::string::String,

    /// Makes the operation only succeed conditional on whether the folder's
    /// current metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation only succeed conditional on whether the folder's
    /// current metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
    }
}

/// Request message for ListFolders. This operation is only applicable to a
/// hierarchical namespace enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFoldersRequest {
    /// Required. Name of the bucket in which to look for folders. The bucket must
    /// be a hierarchical namespace enabled bucket.
    pub parent: std::string::String,

    /// Optional. Maximum number of folders to return in a single response. The
    /// service will use this parameter or 1,000 items, whichever is smaller.
    pub page_size: i32,

    /// Optional. A previously-returned page token representing part of the larger
    /// set of results to view.
    pub page_token: std::string::String,

    /// Optional. Filter results to folders whose names begin with this prefix.
    /// If set, the value must either be an empty string or end with a '/'.
    pub prefix: std::string::String,

    /// Optional. If set, returns results in a directory-like mode. The results
    /// will only include folders that either exactly match the above prefix, or
    /// are one level below the prefix. The only supported value is '/'.
    pub delimiter: std::string::String,

    /// Optional. Filter results to folders whose names are lexicographically equal
    /// to or after lexicographic_start. If lexicographic_end is also set, the
    /// folders listed have names between lexicographic_start (inclusive) and
    /// lexicographic_end (exclusive).
    pub lexicographic_start: std::string::String,

    /// Optional. Filter results to folders whose names are lexicographically
    /// before lexicographic_end. If lexicographic_start is also set, the folders
    /// listed have names between lexicographic_start (inclusive) and
    /// lexicographic_end (exclusive).
    pub lexicographic_end: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFoldersRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.delimiter = v.into();
        self
    }

    /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.lexicographic_start = v.into();
        self
    }

    /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.lexicographic_end = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for ListFoldersRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
    }
}

/// Response message for ListFolders.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFoldersResponse {
    /// The list of child folders
    pub folders: std::vec::Vec<crate::model::Folder>,

    /// The continuation token, used to page through large result sets. Provide
    /// this value in a subsequent request to return the next page of results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListFoldersResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
    pub fn set_folders<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::Folder>,
    {
        use std::iter::Iterator;
        self.folders = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListFoldersResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListFoldersResponse {
    type PageItem = crate::model::Folder;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.folders
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Request message for RenameFolder. This operation is only applicable to a
/// hierarchical namespace enabled bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RenameFolderRequest {
    /// Required. Name of the source folder being renamed.
    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
    pub name: std::string::String,

    /// Required. The destination folder ID, e.g. `foo/bar/`.
    pub destination_folder_id: std::string::String,

    /// Makes the operation only succeed conditional on whether the source
    /// folder's current metageneration matches the given value.
    pub if_metageneration_match: std::option::Option<i64>,

    /// Makes the operation only succeed conditional on whether the source
    /// folder's current metageneration does not match the given value.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RenameFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::RenameFolderRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_folder_id = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for RenameFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
    }
}

/// The message contains metadata that is common to all Storage Control
/// long-running operations, present in its `google.longrunning.Operation`
/// messages, and accessible via `metadata.common_metadata`.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CommonLongRunningOperationMetadata {
    /// Output only. The time the operation was created.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation finished running.
    pub end_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The time the operation was last modified.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The type of operation invoked.
    pub r#type: std::string::String,

    /// Output only. Identifies whether the user has requested cancellation.
    pub requested_cancellation: bool,

    /// Output only. The estimated progress of the operation in percentage [0,
    /// 100]. The value -1 means the progress is unknown.
    pub progress_percent: i32,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CommonLongRunningOperationMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
    pub fn set_end_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.end_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.r#type = v.into();
        self
    }

    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.requested_cancellation = v.into();
        self
    }

    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.progress_percent = v.into();
        self
    }
}

impl wkt::message::Message for CommonLongRunningOperationMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
    }
}

/// Message returned in the metadata field of the Operation resource for
/// RenameFolder operations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct RenameFolderMetadata {
    /// Generic metadata for the long running operation.
    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,

    /// The path of the source folder.
    pub source_folder_id: std::string::String,

    /// The path of the destination folder.
    pub destination_folder_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl RenameFolderMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
    pub fn set_common_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.source_folder_id = v.into();
        self
    }

    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.destination_folder_id = v.into();
        self
    }
}

impl wkt::message::Message for RenameFolderMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
    }
}

/// The storage layout configuration of a bucket.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct StorageLayout {
    /// Output only. The name of the StorageLayout resource.
    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
    pub name: std::string::String,

    /// Output only. The location of the bucket.
    pub location: std::string::String,

    /// Output only. The location type of the bucket (region, dual-region,
    /// multi-region, etc).
    pub location_type: std::string::String,

    /// Output only. The data placement configuration for custom dual region. If
    /// there is no configuration, this is not a custom dual region bucket.
    pub custom_placement_config:
        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,

    /// Output only. The bucket's hierarchical namespace configuration. If there is
    /// no configuration, the hierarchical namespace is disabled.
    pub hierarchical_namespace:
        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl StorageLayout {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::StorageLayout::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [location][crate::model::StorageLayout::location].
    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location = v.into();
        self
    }

    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.location_type = v.into();
        self
    }

    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
    {
        self.custom_placement_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
    {
        self.custom_placement_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
    {
        self.hierarchical_namespace = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
    {
        self.hierarchical_namespace = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for StorageLayout {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.StorageLayout"
    }
}

/// Defines additional types related to [StorageLayout].
pub mod storage_layout {
    #[allow(unused_imports)]
    use super::*;

    /// Configuration for Custom Dual Regions.  It should specify precisely two
    /// eligible regions within the same Multiregion. More information on regions
    /// may be found [here](https://cloud.google.com/storage/docs/locations).
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct CustomPlacementConfig {
        /// List of locations to use for data placement.
        pub data_locations: std::vec::Vec<std::string::String>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl CustomPlacementConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
        where
            T: std::iter::IntoIterator<Item = V>,
            V: std::convert::Into<std::string::String>,
        {
            use std::iter::Iterator;
            self.data_locations = v.into_iter().map(|i| i.into()).collect();
            self
        }
    }

    impl wkt::message::Message for CustomPlacementConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
        }
    }

    /// Configuration for a bucket's hierarchical namespace feature.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct HierarchicalNamespace {
        /// Enables the hierarchical namespace feature.
        pub enabled: bool,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl HierarchicalNamespace {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
            self.enabled = v.into();
            self
        }
    }

    impl wkt::message::Message for HierarchicalNamespace {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
        }
    }
}

/// Request message for GetStorageLayout.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetStorageLayoutRequest {
    /// Required. The name of the StorageLayout resource.
    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
    pub name: std::string::String,

    /// An optional prefix used for permission check. It is useful when the caller
    /// only has limited permissions under a specific prefix.
    pub prefix: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetStorageLayoutRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for GetStorageLayoutRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
    }
}

/// A managed folder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ManagedFolder {
    /// Identifier. The name of this managed folder.
    /// Format:
    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
    pub name: std::string::String,

    /// Output only. The metadata version of this managed folder. It increases
    /// whenever the metadata is updated. Used for preconditions and for detecting
    /// changes in metadata. Managed folders don't have a generation number.
    pub metageneration: i64,

    /// Output only. The creation time of the managed folder.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. The modification time of the managed folder.
    pub update_time: std::option::Option<wkt::Timestamp>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ManagedFolder {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ManagedFolder::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
        self.metageneration = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for ManagedFolder {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
    }
}

/// Request message for GetManagedFolder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetManagedFolderRequest {
    /// Required. Name of the managed folder.
    /// Format:
    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
    pub name: std::string::String,

    /// The operation succeeds conditional on the managed folder's current
    /// metageneration matching the value here specified.
    pub if_metageneration_match: std::option::Option<i64>,

    /// The operation succeeds conditional on the managed folder's current
    /// metageneration NOT matching the value here specified.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetManagedFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for GetManagedFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
    }
}

/// Request message for CreateManagedFolder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateManagedFolderRequest {
    /// Required. Name of the bucket this managed folder belongs to.
    pub parent: std::string::String,

    /// Required. Properties of the managed folder being created.
    /// The bucket and managed folder names are specified in the `parent` and
    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
    /// will result in an error.
    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,

    /// Required. The name of the managed folder. It uses a single `/` as delimiter
    /// and leading and trailing `/` are allowed.
    pub managed_folder_id: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateManagedFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
    pub fn set_managed_folder<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::ManagedFolder>,
    {
        self.managed_folder = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::ManagedFolder>,
    {
        self.managed_folder = v.map(|x| x.into());
        self
    }

    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.managed_folder_id = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateManagedFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
    }
}

/// DeleteManagedFolder RPC request message.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteManagedFolderRequest {
    /// Required. Name of the managed folder.
    /// Format:
    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
    pub name: std::string::String,

    /// The operation succeeds conditional on the managed folder's current
    /// metageneration matching the value here specified.
    pub if_metageneration_match: std::option::Option<i64>,

    /// The operation succeeds conditional on the managed folder's current
    /// metageneration NOT matching the value here specified.
    pub if_metageneration_not_match: std::option::Option<i64>,

    /// Allows deletion of a managed folder even if it is not empty.
    /// A managed folder is empty if it manages no child managed folders or
    /// objects. Caller must have permission for
    /// storage.managedFolders.setIamPolicy.
    pub allow_non_empty: bool,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DeleteManagedFolderRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<i64>,
    {
        self.if_metageneration_not_match = v.map(|x| x.into());
        self
    }

    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.allow_non_empty = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DeleteManagedFolderRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
    }
}

/// Request message for ListManagedFolders.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListManagedFoldersRequest {
    /// Required. Name of the bucket this managed folder belongs to.
    pub parent: std::string::String,

    /// Optional. Maximum number of managed folders to return in a single response.
    /// The service will use this parameter or 1,000 items, whichever is smaller.
    pub page_size: i32,

    /// Optional. A previously-returned page token representing part of the larger
    /// set of results to view.
    pub page_token: std::string::String,

    /// Optional. Filter results to match managed folders with name starting with
    /// this prefix.
    pub prefix: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListManagedFoldersRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.prefix = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for ListManagedFoldersRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
    }
}

/// Response message for ListManagedFolders.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListManagedFoldersResponse {
    /// The list of matching managed folders
    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,

    /// The continuation token, used to page through large result sets. Provide
    /// this value in a subsequent request to return the next page of results.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListManagedFoldersResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::ManagedFolder>,
    {
        use std::iter::Iterator;
        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListManagedFoldersResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
    type PageItem = crate::model::ManagedFolder;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.managed_folders
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// Message returned in the metadata field of the Operation resource for
/// CreateAnywhereCache operations.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAnywhereCacheMetadata {
    /// Generic metadata for the long running operation.
    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,

    /// Anywhere Cache ID.
    pub anywhere_cache_id: std::option::Option<std::string::String>,

    /// The zone in which the cache instance is running. For example,
    /// us-central1-a.
    pub zone: std::option::Option<std::string::String>,

    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
    /// cache entries on admission. Default ttl value (24hrs) is applied if not
    /// specified in the create request.
    pub ttl: std::option::Option<wkt::Duration>,

    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
    /// applied if not specified in the create request.
    pub admission_policy: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAnywhereCacheMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
    pub fn set_common_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.anywhere_cache_id = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.anywhere_cache_id = v.map(|x| x.into());
        self
    }

    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
    pub fn set_zone<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.zone = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.zone = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
    pub fn set_ttl<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = v.map(|x| x.into());
        self
    }

    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
    pub fn set_admission_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.admission_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.admission_policy = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for CreateAnywhereCacheMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
    }
}

/// Message returned in the metadata field of the Operation resource for
/// UpdateAnywhereCache operation.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAnywhereCacheMetadata {
    /// Generic metadata for the long running operation.
    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,

    /// Anywhere Cache ID.
    pub anywhere_cache_id: std::option::Option<std::string::String>,

    /// The zone in which the cache instance is running. For example,
    /// us-central1-a.
    pub zone: std::option::Option<std::string::String>,

    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
    /// is applied to all new cache entries on admission. If `ttl` is pending
    /// update, this field equals to the new value specified in the Update request.
    pub ttl: std::option::Option<wkt::Duration>,

    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
    /// "admit-on-first-miss"). If `admission_policy` is pending
    /// update, this field equals to the new value specified in the Update request.
    pub admission_policy: std::option::Option<std::string::String>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateAnywhereCacheMetadata {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
    pub fn set_common_metadata<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
    {
        self.common_metadata = v.map(|x| x.into());
        self
    }

    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.anywhere_cache_id = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.anywhere_cache_id = v.map(|x| x.into());
        self
    }

    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
    pub fn set_zone<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.zone = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.zone = v.map(|x| x.into());
        self
    }

    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
    pub fn set_ttl<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = v.map(|x| x.into());
        self
    }

    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
    pub fn set_admission_policy<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.admission_policy = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<std::string::String>,
    {
        self.admission_policy = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for UpdateAnywhereCacheMetadata {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
    }
}

/// An Anywhere Cache Instance.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AnywhereCache {
    /// Immutable. The resource name of this AnywhereCache.
    /// Format:
    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
    pub name: std::string::String,

    /// Immutable. The zone in which the cache instance is running. For example,
    /// us-central1-a.
    pub zone: std::string::String,

    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
    /// that defines how long a cache entry can live. Default ttl value (24hrs)
    /// is applied if not specified in the create request. TTL must be in whole
    /// seconds.
    pub ttl: std::option::Option<wkt::Duration>,

    /// Cache admission policy. Valid policies includes:
    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
    /// `admit-on-first-miss`. Default value is applied if not specified in the
    /// create request.
    pub admission_policy: std::string::String,

    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
    pub state: std::string::String,

    /// Output only. Time when Anywhere cache instance is allocated.
    pub create_time: std::option::Option<wkt::Timestamp>,

    /// Output only. Time when Anywhere cache instance is last updated, including
    /// creation.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Output only. True if there is an active update operation against this cache
    /// instance. Subsequential update requests will be rejected if this field is
    /// true. Output only.
    pub pending_update: bool,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl AnywhereCache {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::AnywhereCache::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.zone = v.into();
        self
    }

    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
    pub fn set_ttl<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Duration>,
    {
        self.ttl = v.map(|x| x.into());
        self
    }

    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
        mut self,
        v: T,
    ) -> Self {
        self.admission_policy = v.into();
        self
    }

    /// Sets the value of [state][crate::model::AnywhereCache::state].
    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.state = v.into();
        self
    }

    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
    pub fn set_create_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.create_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
        self.pending_update = v.into();
        self
    }
}

impl wkt::message::Message for AnywhereCache {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
    }
}

/// Request message for CreateAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateAnywhereCacheRequest {
    /// Required. The bucket to which this cache belongs.
    /// Format: `projects/{project}/buckets/{bucket}`
    pub parent: std::string::String,

    /// Required. Properties of the Anywhere Cache instance being created.
    /// The parent bucket name is specified in the `parent` field. Server uses the
    /// default value of `ttl` or `admission_policy` if not specified in
    /// request.
    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl CreateAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AnywhereCache>,
    {
        self.anywhere_cache = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AnywhereCache>,
    {
        self.anywhere_cache = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for CreateAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
    }
}

/// Request message for UpdateAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateAnywhereCacheRequest {
    /// Required. The Anywhere Cache instance to be updated.
    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,

    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
    /// include `ttl` and `admission_policy`.
    ///
    /// To specify ALL fields, specify a single field with the value `*`. Note: We
    /// recommend against doing this. If a new field is introduced at a later time,
    /// an older client updating with the `*` may accidentally reset the new
    /// field's value.
    ///
    /// Not specifying any fields is an error.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::AnywhereCache>,
    {
        self.anywhere_cache = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::AnywhereCache>,
    {
        self.anywhere_cache = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
    }
}

/// Request message for DisableAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableAnywhereCacheRequest {
    /// Required. The name field in the request should be:
    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
    pub name: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl DisableAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for DisableAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
    }
}

/// Request message for PauseAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PauseAnywhereCacheRequest {
    /// Required. The name field in the request should be:
    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
    pub name: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl PauseAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for PauseAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
    }
}

/// Request message for ResumeAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResumeAnywhereCacheRequest {
    /// Required. The name field in the request should be:
    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
    pub name: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted. This request is only
    /// idempotent if a `request_id` is provided.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ResumeAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for ResumeAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
    }
}

/// Request message for GetAnywhereCache.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetAnywhereCacheRequest {
    /// Required. The name field in the request should be:
    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
    pub name: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetAnywhereCacheRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for GetAnywhereCacheRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
    }
}

/// Request message for ListAnywhereCaches.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAnywhereCachesRequest {
    /// Required. The bucket to which this cache belongs.
    pub parent: std::string::String,

    /// Maximum number of caches to return in a single response.
    /// The service will use this parameter or 1,000 items, whichever is smaller.
    pub page_size: i32,

    /// A previously-returned page token representing part of the larger set of
    /// results to view.
    pub page_token: std::string::String,

    /// Optional. A unique identifier for this request. UUID is the recommended
    /// format, but other formats are still accepted.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAnywhereCachesRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.parent = v.into();
        self
    }

    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
        self.page_size = v.into();
        self
    }

    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.page_token = v.into();
        self
    }

    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for ListAnywhereCachesRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
    }
}

/// Response message for ListAnywhereCaches.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListAnywhereCachesResponse {
    /// The list of items.
    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,

    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    pub next_page_token: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl ListAnywhereCachesResponse {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
    where
        T: std::iter::IntoIterator<Item = V>,
        V: std::convert::Into<crate::model::AnywhereCache>,
    {
        use std::iter::Iterator;
        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
        self
    }

    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.next_page_token = v.into();
        self
    }
}

impl wkt::message::Message for ListAnywhereCachesResponse {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
    }
}

#[doc(hidden)]
impl gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
    type PageItem = crate::model::AnywhereCache;

    fn items(self) -> std::vec::Vec<Self::PageItem> {
        self.anywhere_caches
    }

    fn next_page_token(&self) -> std::string::String {
        use std::clone::Clone;
        self.next_page_token.clone()
    }
}

/// The `IntelligenceConfig` resource associated with your organization, folder,
/// or project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct IntelligenceConfig {
    /// Identifier. The name of the `IntelligenceConfig` resource associated with
    /// your organization, folder, or project.
    ///
    /// The name format varies based on the GCP resource hierarchy as follows:
    ///
    /// * For project:
    ///   `projects/{project_number}/locations/global/intelligenceConfig`
    /// * For organization:
    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
    pub name: std::string::String,

    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
    pub edition_config: crate::model::intelligence_config::EditionConfig,

    /// Output only. The time at which the `IntelligenceConfig` resource is last
    /// updated.
    pub update_time: std::option::Option<wkt::Timestamp>,

    /// Optional. Filter over location and bucket.
    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,

    /// Output only. The `IntelligenceConfig` resource that is applicable for the
    /// resource.
    pub effective_intelligence_config:
        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,

    /// The trial configuration of the `IntelligenceConfig` resource.
    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl IntelligenceConfig {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }

    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
    pub fn set_edition_config<
        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
    >(
        mut self,
        v: T,
    ) -> Self {
        self.edition_config = v.into();
        self
    }

    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
    pub fn set_update_time<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::Timestamp>,
    {
        self.update_time = v.map(|x| x.into());
        self
    }

    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
    pub fn set_filter<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::Filter>,
    {
        self.filter = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::Filter>,
    {
        self.filter = v.map(|x| x.into());
        self
    }

    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
    {
        self.effective_intelligence_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
    pub fn set_or_clear_effective_intelligence_config<T>(
        mut self,
        v: std::option::Option<T>,
    ) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
    {
        self.effective_intelligence_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
    pub fn set_trial_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
    {
        self.trial_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
    {
        self.trial_config = v.map(|x| x.into());
        self
    }
}

impl wkt::message::Message for IntelligenceConfig {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
    }
}

/// Defines additional types related to [IntelligenceConfig].
pub mod intelligence_config {
    #[allow(unused_imports)]
    use super::*;

    /// Filter over location and bucket using include or exclude semantics.
    /// Resources that match the include or exclude filter are exclusively included
    /// or excluded from the Storage Intelligence plan.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct Filter {
        /// Bucket locations to include or exclude.
        pub cloud_storage_locations: std::option::Option<
            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
        >,

        /// Buckets to include or exclude.
        pub cloud_storage_buckets: std::option::Option<
            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
        >,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl Filter {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
        ///
        /// Note that all the setters affecting `cloud_storage_locations` are mutually
        /// exclusive.
        pub fn set_cloud_storage_locations<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_locations = v.into();
            self
        }

        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
        /// holds a different branch.
        pub fn included_cloud_storage_locations(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
        > {
            #[allow(unreachable_patterns)]
            self.cloud_storage_locations.as_ref().and_then(|v| match v {
                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
        /// to hold a `IncludedCloudStorageLocations`.
        ///
        /// Note that all the setters affecting `cloud_storage_locations` are
        /// mutually exclusive.
        pub fn set_included_cloud_storage_locations<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::intelligence_config::filter::CloudStorageLocations,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_locations = std::option::Option::Some(
                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
                    v.into()
                )
            );
            self
        }

        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
        /// holds a different branch.
        pub fn excluded_cloud_storage_locations(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
        > {
            #[allow(unreachable_patterns)]
            self.cloud_storage_locations.as_ref().and_then(|v| match v {
                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
        /// to hold a `ExcludedCloudStorageLocations`.
        ///
        /// Note that all the setters affecting `cloud_storage_locations` are
        /// mutually exclusive.
        pub fn set_excluded_cloud_storage_locations<
            T: std::convert::Into<
                    std::boxed::Box<
                        crate::model::intelligence_config::filter::CloudStorageLocations,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_locations = std::option::Option::Some(
                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
                    v.into()
                )
            );
            self
        }

        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
        ///
        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
        /// exclusive.
        pub fn set_cloud_storage_buckets<
            T: std::convert::Into<
                    std::option::Option<
                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
                    >,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_buckets = v.into();
            self
        }

        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
        /// holds a different branch.
        pub fn included_cloud_storage_buckets(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
        > {
            #[allow(unreachable_patterns)]
            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
        /// to hold a `IncludedCloudStorageBuckets`.
        ///
        /// Note that all the setters affecting `cloud_storage_buckets` are
        /// mutually exclusive.
        pub fn set_included_cloud_storage_buckets<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_buckets = std::option::Option::Some(
                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
                    v.into()
                )
            );
            self
        }

        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
        /// holds a different branch.
        pub fn excluded_cloud_storage_buckets(
            &self,
        ) -> std::option::Option<
            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
        > {
            #[allow(unreachable_patterns)]
            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
                _ => std::option::Option::None,
            })
        }

        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
        /// to hold a `ExcludedCloudStorageBuckets`.
        ///
        /// Note that all the setters affecting `cloud_storage_buckets` are
        /// mutually exclusive.
        pub fn set_excluded_cloud_storage_buckets<
            T: std::convert::Into<
                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
                >,
        >(
            mut self,
            v: T,
        ) -> Self {
            self.cloud_storage_buckets = std::option::Option::Some(
                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
                    v.into()
                )
            );
            self
        }
    }

    impl wkt::message::Message for Filter {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
        }
    }

    /// Defines additional types related to [Filter].
    pub mod filter {
        #[allow(unused_imports)]
        use super::*;

        /// Collection of bucket locations.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct CloudStorageLocations {
            /// Optional. Bucket locations. Location can be any of the Cloud Storage
            /// regions specified in lower case format. For example, `us-east1`,
            /// `us-west1`.
            pub locations: std::vec::Vec<std::string::String>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl CloudStorageLocations {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
            pub fn set_locations<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.locations = v.into_iter().map(|i| i.into()).collect();
                self
            }
        }

        impl wkt::message::Message for CloudStorageLocations {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
            }
        }

        /// Collection of buckets.
        #[derive(Clone, Default, PartialEq)]
        #[non_exhaustive]
        pub struct CloudStorageBuckets {
            /// Optional. A regex pattern for matching bucket names. Regex should
            /// follow the syntax specified in
            /// [google/re2](https://github.com/google/re2). For example,
            /// `^sample_.*` matches all buckets of the form
            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
            /// If you want to match a single bucket, say `gs://sample_bucket`,
            /// use `sample_bucket`.
            pub bucket_id_regexes: std::vec::Vec<std::string::String>,

            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
        }

        impl CloudStorageBuckets {
            pub fn new() -> Self {
                std::default::Default::default()
            }

            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
            where
                T: std::iter::IntoIterator<Item = V>,
                V: std::convert::Into<std::string::String>,
            {
                use std::iter::Iterator;
                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
                self
            }
        }

        impl wkt::message::Message for CloudStorageBuckets {
            fn typename() -> &'static str {
                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
            }
        }

        /// Bucket locations to include or exclude.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum CloudStorageLocationsOneOf {
            /// Bucket locations to include.
            IncludedCloudStorageLocations(
                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
            ),
            /// Bucket locations to exclude.
            ExcludedCloudStorageLocations(
                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
            ),
        }

        impl CloudStorageLocationsOneOf {
            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
            pub fn from_included_cloud_storage_locations(
                value: impl std::convert::Into<
                    std::boxed::Box<
                        crate::model::intelligence_config::filter::CloudStorageLocations,
                    >,
                >,
            ) -> Self {
                Self::IncludedCloudStorageLocations(value.into())
            }
            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
            pub fn from_excluded_cloud_storage_locations(
                value: impl std::convert::Into<
                    std::boxed::Box<
                        crate::model::intelligence_config::filter::CloudStorageLocations,
                    >,
                >,
            ) -> Self {
                Self::ExcludedCloudStorageLocations(value.into())
            }
        }

        /// Buckets to include or exclude.
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum CloudStorageBucketsOneOf {
            /// Buckets to include.
            IncludedCloudStorageBuckets(
                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
            ),
            /// Buckets to exclude.
            ExcludedCloudStorageBuckets(
                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
            ),
        }

        impl CloudStorageBucketsOneOf {
            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
            pub fn from_included_cloud_storage_buckets(
                value: impl std::convert::Into<
                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
                >,
            ) -> Self {
                Self::IncludedCloudStorageBuckets(value.into())
            }
            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
            pub fn from_excluded_cloud_storage_buckets(
                value: impl std::convert::Into<
                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
                >,
            ) -> Self {
                Self::ExcludedCloudStorageBuckets(value.into())
            }
        }
    }

    /// The effective `IntelligenceConfig` for the resource.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct EffectiveIntelligenceConfig {
        /// Output only. The `IntelligenceConfig` edition that is applicable for the
        /// resource.
        pub effective_edition:
            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,

        /// Output only. The `IntelligenceConfig` resource that is applied for the
        /// target resource. Format:
        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
        pub intelligence_config: std::string::String,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl EffectiveIntelligenceConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
            self.effective_edition = v.into();
            self
        }

        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
            mut self,
            v: T,
        ) -> Self {
            self.intelligence_config = v.into();
            self
        }
    }

    impl wkt::message::Message for EffectiveIntelligenceConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
        }
    }

    /// Defines additional types related to [EffectiveIntelligenceConfig].
    pub mod effective_intelligence_config {
        #[allow(unused_imports)]
        use super::*;

        /// The effective edition of the `IntelligenceConfig` resource.
        ///
        /// # Working with unknown values
        ///
        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
        /// additional enum variants at any time. Adding new variants is not considered
        /// a breaking change. Applications should write their code in anticipation of:
        ///
        /// - New values appearing in future releases of the client library, **and**
        /// - New values received dynamically, without application changes.
        ///
        /// Please consult the [Working with enums] section in the user guide for some
        /// guidelines.
        ///
        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
        #[derive(Clone, Debug, PartialEq)]
        #[non_exhaustive]
        pub enum EffectiveEdition {
            /// This is an unknown edition of the resource.
            Unspecified,
            /// No edition.
            None,
            /// The `IntelligenceConfig` resource is of STANDARD edition.
            Standard,
            /// If set, the enum was initialized with an unknown value.
            ///
            /// Applications can examine the value using [EffectiveEdition::value] or
            /// [EffectiveEdition::name].
            UnknownValue(effective_edition::UnknownValue),
        }

        #[doc(hidden)]
        pub mod effective_edition {
            #[allow(unused_imports)]
            use super::*;
            #[derive(Clone, Debug, PartialEq)]
            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
        }

        impl EffectiveEdition {
            /// Gets the enum value.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the string representation of enums.
            pub fn value(&self) -> std::option::Option<i32> {
                match self {
                    Self::Unspecified => std::option::Option::Some(0),
                    Self::None => std::option::Option::Some(1),
                    Self::Standard => std::option::Option::Some(2),
                    Self::UnknownValue(u) => u.0.value(),
                }
            }

            /// Gets the enum value as a string.
            ///
            /// Returns `None` if the enum contains an unknown value deserialized from
            /// the integer representation of enums.
            pub fn name(&self) -> std::option::Option<&str> {
                match self {
                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
                    Self::None => std::option::Option::Some("NONE"),
                    Self::Standard => std::option::Option::Some("STANDARD"),
                    Self::UnknownValue(u) => u.0.name(),
                }
            }
        }

        impl std::default::Default for EffectiveEdition {
            fn default() -> Self {
                use std::convert::From;
                Self::from(0)
            }
        }

        impl std::fmt::Display for EffectiveEdition {
            fn fmt(
                &self,
                f: &mut std::fmt::Formatter<'_>,
            ) -> std::result::Result<(), std::fmt::Error> {
                wkt::internal::display_enum(f, self.name(), self.value())
            }
        }

        impl std::convert::From<i32> for EffectiveEdition {
            fn from(value: i32) -> Self {
                match value {
                    0 => Self::Unspecified,
                    1 => Self::None,
                    2 => Self::Standard,
                    _ => Self::UnknownValue(effective_edition::UnknownValue(
                        wkt::internal::UnknownEnumValue::Integer(value),
                    )),
                }
            }
        }

        impl std::convert::From<&str> for EffectiveEdition {
            fn from(value: &str) -> Self {
                use std::string::ToString;
                match value {
                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
                    "NONE" => Self::None,
                    "STANDARD" => Self::Standard,
                    _ => Self::UnknownValue(effective_edition::UnknownValue(
                        wkt::internal::UnknownEnumValue::String(value.to_string()),
                    )),
                }
            }
        }

        impl serde::ser::Serialize for EffectiveEdition {
            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
            where
                S: serde::Serializer,
            {
                match self {
                    Self::Unspecified => serializer.serialize_i32(0),
                    Self::None => serializer.serialize_i32(1),
                    Self::Standard => serializer.serialize_i32(2),
                    Self::UnknownValue(u) => u.0.serialize(serializer),
                }
            }
        }

        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
            where
                D: serde::Deserializer<'de>,
            {
                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
            }
        }
    }

    /// The trial configuration of the `IntelligenceConfig` resource.
    #[derive(Clone, Default, PartialEq)]
    #[non_exhaustive]
    pub struct TrialConfig {
        /// Output only. The time at which the trial expires.
        pub expire_time: std::option::Option<wkt::Timestamp>,

        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
    }

    impl TrialConfig {
        pub fn new() -> Self {
            std::default::Default::default()
        }

        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
        pub fn set_expire_time<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.expire_time = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<wkt::Timestamp>,
        {
            self.expire_time = v.map(|x| x.into());
            self
        }
    }

    impl wkt::message::Message for TrialConfig {
        fn typename() -> &'static str {
            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
        }
    }

    /// The edition configuration of the `IntelligenceConfig` resource. This
    /// signifies the edition used for configuring the `IntelligenceConfig`
    /// resource and can only take the following values:
    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
    /// `TRIAL`.
    ///
    /// # Working with unknown values
    ///
    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
    /// additional enum variants at any time. Adding new variants is not considered
    /// a breaking change. Applications should write their code in anticipation of:
    ///
    /// - New values appearing in future releases of the client library, **and**
    /// - New values received dynamically, without application changes.
    ///
    /// Please consult the [Working with enums] section in the user guide for some
    /// guidelines.
    ///
    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
    #[derive(Clone, Debug, PartialEq)]
    #[non_exhaustive]
    pub enum EditionConfig {
        /// This is an unknown edition of the resource.
        Unspecified,
        /// The inherited edition from the parent and filters. This is the default
        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
        Inherit,
        /// The edition configuration is disabled for the `IntelligenceConfig`
        /// resource and its children. Filters are not applicable.
        Disabled,
        /// The `IntelligenceConfig` resource is of STANDARD edition.
        Standard,
        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
        /// the trial period, Cloud Storage does not charge for Storage Intelligence
        /// usage. You can specify the buckets to include in the trial period by
        /// using filters. At the end of the trial period, the `IntelligenceConfig`
        /// resource is upgraded to `STANDARD` edition.
        Trial,
        /// If set, the enum was initialized with an unknown value.
        ///
        /// Applications can examine the value using [EditionConfig::value] or
        /// [EditionConfig::name].
        UnknownValue(edition_config::UnknownValue),
    }

    #[doc(hidden)]
    pub mod edition_config {
        #[allow(unused_imports)]
        use super::*;
        #[derive(Clone, Debug, PartialEq)]
        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
    }

    impl EditionConfig {
        /// Gets the enum value.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the string representation of enums.
        pub fn value(&self) -> std::option::Option<i32> {
            match self {
                Self::Unspecified => std::option::Option::Some(0),
                Self::Inherit => std::option::Option::Some(1),
                Self::Disabled => std::option::Option::Some(2),
                Self::Standard => std::option::Option::Some(3),
                Self::Trial => std::option::Option::Some(5),
                Self::UnknownValue(u) => u.0.value(),
            }
        }

        /// Gets the enum value as a string.
        ///
        /// Returns `None` if the enum contains an unknown value deserialized from
        /// the integer representation of enums.
        pub fn name(&self) -> std::option::Option<&str> {
            match self {
                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
                Self::Inherit => std::option::Option::Some("INHERIT"),
                Self::Disabled => std::option::Option::Some("DISABLED"),
                Self::Standard => std::option::Option::Some("STANDARD"),
                Self::Trial => std::option::Option::Some("TRIAL"),
                Self::UnknownValue(u) => u.0.name(),
            }
        }
    }

    impl std::default::Default for EditionConfig {
        fn default() -> Self {
            use std::convert::From;
            Self::from(0)
        }
    }

    impl std::fmt::Display for EditionConfig {
        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
            wkt::internal::display_enum(f, self.name(), self.value())
        }
    }

    impl std::convert::From<i32> for EditionConfig {
        fn from(value: i32) -> Self {
            match value {
                0 => Self::Unspecified,
                1 => Self::Inherit,
                2 => Self::Disabled,
                3 => Self::Standard,
                5 => Self::Trial,
                _ => Self::UnknownValue(edition_config::UnknownValue(
                    wkt::internal::UnknownEnumValue::Integer(value),
                )),
            }
        }
    }

    impl std::convert::From<&str> for EditionConfig {
        fn from(value: &str) -> Self {
            use std::string::ToString;
            match value {
                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
                "INHERIT" => Self::Inherit,
                "DISABLED" => Self::Disabled,
                "STANDARD" => Self::Standard,
                "TRIAL" => Self::Trial,
                _ => Self::UnknownValue(edition_config::UnknownValue(
                    wkt::internal::UnknownEnumValue::String(value.to_string()),
                )),
            }
        }
    }

    impl serde::ser::Serialize for EditionConfig {
        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
        where
            S: serde::Serializer,
        {
            match self {
                Self::Unspecified => serializer.serialize_i32(0),
                Self::Inherit => serializer.serialize_i32(1),
                Self::Disabled => serializer.serialize_i32(2),
                Self::Standard => serializer.serialize_i32(3),
                Self::Trial => serializer.serialize_i32(5),
                Self::UnknownValue(u) => u.0.serialize(serializer),
            }
        }
    }

    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
        where
            D: serde::Deserializer<'de>,
        {
            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
            ))
        }
    }
}

/// Request message to update the `IntelligenceConfig` resource associated with
/// your organization.
///
/// **IAM Permissions**:
///
/// Requires `storage.intelligenceConfigs.update`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
/// the organization.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateOrganizationIntelligenceConfigRequest {
    /// Required. The `IntelligenceConfig` resource to be updated.
    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,

    /// Required. The `update_mask` that specifies the fields within the
    /// `IntelligenceConfig` resource that should be modified by this update. Only
    /// the listed fields are updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. The ID that uniquely identifies the request, preventing duplicate
    /// processing.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateOrganizationIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
    }
}

/// Request message to update the `IntelligenceConfig` resource associated with
/// your folder.
///
/// **IAM Permissions**:
///
/// Requires `storage.intelligenceConfigs.update`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
/// the folder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFolderIntelligenceConfigRequest {
    /// Required. The `IntelligenceConfig` resource to be updated.
    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,

    /// Required. The `update_mask` that specifies the fields within the
    /// `IntelligenceConfig` resource that should be modified by this update. Only
    /// the listed fields are updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. The ID that uniquely identifies the request, preventing duplicate
    /// processing.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateFolderIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
    }
}

/// Request message to update the `IntelligenceConfig` resource associated with
/// your project.
///
/// **IAM Permissions**:
///
/// Requires `storage.intelligenceConfigs.update`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
/// the folder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateProjectIntelligenceConfigRequest {
    /// Required. The `IntelligenceConfig` resource to be updated.
    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,

    /// Required. The `update_mask` that specifies the fields within the
    /// `IntelligenceConfig` resource that should be modified by this update. Only
    /// the listed fields are updated.
    pub update_mask: std::option::Option<wkt::FieldMask>,

    /// Optional. The ID that uniquely identifies the request, preventing duplicate
    /// processing.
    pub request_id: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl UpdateProjectIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<crate::model::IntelligenceConfig>,
    {
        self.intelligence_config = v.map(|x| x.into());
        self
    }

    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
    pub fn set_update_mask<T>(mut self, v: T) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = std::option::Option::Some(v.into());
        self
    }

    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
    where
        T: std::convert::Into<wkt::FieldMask>,
    {
        self.update_mask = v.map(|x| x.into());
        self
    }

    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.request_id = v.into();
        self
    }
}

impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
    }
}

/// Request message to get the `IntelligenceConfig` resource associated with your
/// organization.
///
/// **IAM Permissions**
///
/// Requires `storage.intelligenceConfigs.get`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
/// the organization.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetOrganizationIntelligenceConfigRequest {
    /// Required. The name of the `IntelligenceConfig` resource associated with
    /// your organization.
    ///
    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetOrganizationIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
    }
}

/// Request message to get the `IntelligenceConfig` resource associated with your
/// folder.
///
/// **IAM Permissions**
///
/// Requires `storage.intelligenceConfigs.get`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
/// the folder.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFolderIntelligenceConfigRequest {
    /// Required. The name of the `IntelligenceConfig` resource associated with
    /// your folder.
    ///
    /// Format: `folders/{id}/locations/global/intelligenceConfig`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetFolderIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
    }
}

/// Request message to get the `IntelligenceConfig` resource associated with your
/// project.
///
/// **IAM Permissions**:
///
/// Requires `storage.intelligenceConfigs.get`
/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
/// on the project.
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetProjectIntelligenceConfigRequest {
    /// Required. The name of the `IntelligenceConfig` resource associated with
    /// your project.
    ///
    /// Format: `projects/{id}/locations/global/intelligenceConfig`
    pub name: std::string::String,

    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}

impl GetProjectIntelligenceConfigRequest {
    pub fn new() -> Self {
        std::default::Default::default()
    }

    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
        self.name = v.into();
        self
    }
}

impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
    fn typename() -> &'static str {
        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
    }
}
